#import "scene_dummy.h"

@implementation SceneDummy

@synthesize menuState = menuState_;

- (id)initSceneDummy:(int)Flag
{
	SpriteDummy *loading;

	if ((self = [super init]))
	{
		/*flag
		*/
		flagSceneChange_ = Flag;

		/*tick
		*/
		[self schedule:@selector(tick:)];

		/*loading image
		*/
		loading = [[SpriteDummy alloc] initSpriteDummy:false];
		[self addChild:loading];
		[loading release];
		loading.positionInPixels = g_ScrrenCenter;
	}
	return self;
}

- (void)tick:(ccTime)Time
{
	scene_comic *sceneComic;
	SceneMenu *sceneMenu;
	scene_game *sceneGame;
	scene_library *sceneLibrary;

	[self unschedule:@selector(tick:)];
	switch (flagSceneChange_)
	{
	case SCENE_CHANGE_TO_COMIC:
		sceneComic = [[scene_comic alloc] initComic];
		[[CCDirector sharedDirector] replaceScene:sceneComic];
		[sceneComic release];
		break;
	case SCENE_CHANGE_TO_MENU:
		sceneMenu = [[scene_menu alloc] initSceneMenu];
		[[CCDirector sharedDirector] replaceScene:sceneMenu];
		[sceneMenu release];
		switch (menuState_)
		{
		case SCENE_MENU_STATE_MAIN:[sceneMenu SetState:SCENE_MENU_STATE_MAIN]; break;
		case SCENE_MENU_STATE_CHAPTER:
			[sceneMenu SetState:SCENE_MENU_STATE_CHAPTER];
			[g_LayerMenuChapter SelectMission:g_ChapterMissionID];
			break;
		case SCENE_MENU_STATE_OPTION: assert(false); break;
		default:;
		}
		break;
	case SCENE_CHANGE_TO_GAME:
		sceneGame = [[scene_game alloc] initSceneGame];
		[[CCDirector sharedDirector] replaceScene:sceneGame];
		[sceneGame release];
		break;
	case SCENE_CHANGE_TO_LIBRARY:
		sceneLibrary = [[scene_library alloc] initSceneLibrary];
		[[CCDirector sharedDirector] replaceScene:sceneLibrary];
		[sceneLibrary release];
		break;
	default:;
	}
}

@end